package com.atguigu.gmall.activity.service;

import com.atguigu.gmall.model.activity.SeckillGoods;
import com.atguigu.gmall.model.activity.SeckillOrder;
import com.atguigu.gmall.model.activity.UserRecode;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

/**
 * 秒杀service
 */
public interface SecKillService {

    /**
     * 获取当前时间段的秒杀商品列表
     * @param date
     * @return
     */
    public List<SeckillGoods> getGoodsList(String date);

    /**
     * 获取商品详情
     * @param date
     * @param id
     * @return
     */
    public SeckillGoods getGoods(String date,String id);

    /**
     * 用户下单排队
     * @param time
     * @param userId
     * @param skuId
     * @return
     */
    public UserRecode userRecode(String time, String userId, String skuId);

    /**
     * 查询用户排队信息
     * @param userId
     * @return
     */
    public UserRecode getUserRecode(String userId);

    /**
     * 查询秒杀订单
     * @param userId
     * @param orderId
     * @return
     */
    public List<SeckillOrder> getSeKillOrderList(String userId, String orderId);

    /**
     * 支付成功修改订单状态
     * @param map
     */
    void paySuccess(Map<String, String> map) throws UnsupportedEncodingException;

    /**
     * 支付失败修改订单状态
     * @param map
     */
    void payFail(Map<String, String> map) throws UnsupportedEncodingException;
}
